<template>
<div class="dy-main EAccountOpenSucces">
  <div class="dy-header">
    <x-header :right-options="{showMore: false}"  :left-options="{backText: '',preventGoBack: true}" @on-click-more="showMenus = true" @on-click-back="back">绑定成功</x-header>
  </div>
  <div class="dy-body">
    <div class="succes">
      <div class="img-box-success"></div>
      <div class="financial-buy-result">绑定成功</div>
    </div>
    <div class="financial-buy-result">
      <div class="financial-buy-result-detail">
        <div><div class="result-item-left">电子账户</div><div class="result-item-right">{{acctNo}}</div></div>
        <div><div class="result-item-left">绑定卡号</div><div class="result-item-right">{{eaccountData.cardNo}}</div></div>
      </div>
    </div>
    <div class="financial-result-button">
      <x-button class="subBtn" type="primary" action-type="button" @click.native="gotoHome">完成</x-button>
    </div>
  </div>
</div>
</template>

<script>

export default {
  data () {
    return {
      returnData: '', // 返回数据
      acctNo: '', // 电子账户
      eaccountData: {
        cardNo: '', // 绑定卡号
        cardInsName: '' // 发证机构
      }

    }
  },
  methods: {
    back () {
      this.$publicFun.goBack(this)
    },
    gotoHome: function () {
      if (this.eaccountData.cardNo !== '' || this.eaccountData.cardInsName !== '') {
        this.$store.commit('addEAccountInfo', this.eaccountData)
      }
      this.$router.push({name: 'EAccountDtail', query: {'cardNo': this.eaccountData.cardNo, 'cardInsName': this.eaccountData.cardInsName}})
    },
    getData () {
      let _this = this
      this.$bridge.callhandler('nativeRequest',
        JSON.stringify({
          'requstSource': 'internetRequest',
          'url': 'mstep.do?act=business',
          'params': {'method_Name': 'CI004006', 'basic_Data': {'acctNo': '', 'bindCard': '', 'bankCode': '', 'mobile': '', 'smsCode': ''}}
        }),
        function (response) {
          // alert(response)
          response = JSON.parse(response)
          if (response.status === 0 || response.status === '0') {
            _this.returnData = response.data.data[0].arrays
          } else {
            console.log('fail')
          }
        })
    }
  },
  computed: {
    getEAccountInfoType () {
      return this.$store.getters.getEAccountInfoType
    }
  },
  mounted () {
    this.eaccountData.cardNo = this.$route.query.cardNo
    this.eaccountData.cardInsName = this.$route.query.cardInsName
    this.acctNo = '12333'
    // this.e accountData.acctType = this.$route.query.acctType
  }
}
</script>

<style lang="less">
.EAccountOpenSucces {
  .succes {
    .img-box-success{
      width: 1.08rem;
      height: 1.08rem;
      margin-top: .8rem;
      margin-bottom: .52rem;
      margin-left: 50%;
      transform: translateX(-50%);
      background: url(../../assets/img/Financial/FinancialBuyResultSuccess.png) no-repeat left top;
      background-size: 100% 100%;
    }
    .img-box-failed{
      width: 1.08rem;
      height: 1.08rem;
      margin-top:.8rem;
      margin-bottom: .52rem;
      margin-left: 50%;
      transform: translateX(-50%);
      background: url(../../assets/img/Financial/zunxiang.png) no-repeat left top;
      background-size: 100% 100%;
    }
  }
  .financial-buy-result{
    text-align: center;
    font-size: .3rem;
    .financial-buy-result-detail{
      font-size:.28rem;
      margin:.68rem .3rem 1.12rem .3rem;
      padding: 0.26rem .3rem;
      border-radius: .28rem;
      background: #fff;
    }
    .financial-buy-result-detail>div{
      padding: .14rem 0;
      .result-item-left{
        /* display:inline-block; */
        width:30%;
        float: left;
        color:rgba(153,153,153,1);
      }
      .result-item-right{
        display:inline-block;
        text-align: right;
        width:70%;
        color:rgba(51,51,51,1);
      }
    }
  }
  .financial-result-button{
    padding: .32rem .4rem;
  }
}
</style>
